package zdream.pmfield.stage.message;

import java.util.Objects;

import zdream.pmfield.stage.director.Director;
import zdream.pmfield.stage.object.FoeActor;

/**
 * @author Zdream
 * @date 2023-11-13
 * @since 0.0.1
 */
public class ActionRequestMessage extends NeedReplyMessage<ActionRequestReply> {
	public final FoeActor foe;
	public final boolean movable;

	public ActionRequestMessage(Director.Turn turn) {
		this.type = StageMessageType.ACTION_REQUEST;
		Objects.requireNonNull(turn);
		this.foe = turn.owner;
		this.movable = turn.movable;
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder(80);
		builder.append("[AR]").append(' ').append("选择接下来的行动:").append(' ').append(foe);

		builder.append(' ').append("剩余行动力").append(':').append(' ').append(foe.actionPoint);
		builder.append(' ').append("移动力").append(':').append(' ').append(foe.movePoint);

		if (!movable) {
			builder.append(' ').append("不允许移动");
		}

		return builder.toString();
	}

	@Override
	public ActionRequestReply createReplyTemplate() {
		return new ActionRequestReply(this);
	}
}
